import xlrd,xlwt
wb=xlrd.open_workbook('字符串应用.xls')
ws=wb.sheet_by_name('字符串1')
nwb=xlwt.Workbook(encoding='utf-8')
nws=nwb.add_sheet('字符串应用结果')
n=0
for c in ws.col_values(0):
    nws.write(n,0,c[:3])
    nws.write(n,1,c[4:])
    nws.write(n,2,ws.cell_value(n,1))
    n+=1
nwb.save('字符串应用11.xls')

# while n<ws.nrows: #用while来遍历所有行
#     nws.write(n,0,ws.cell_value(n,0)[:3])
#     nws.write(n,1,ws.cell_value(n,0)[4:])
#     nws.write(n,2,ws.cell_value(n,1))
#     n+=1
# nwb.save('字符串应用1.xls')